package com.wangy.net.http;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;

public class RequestResult {


	private InputStream inputStream;
	
	private OutputStream outputStream;
	
	private int responseCode;
	
	private String sessionId;
	
	public static RequestResult create(HttpURLConnection connection) throws IOException{
		RequestResult result = new RequestResult();
		result.setInputStream(connection.getInputStream());
		result.setOutputStream(connection.getOutputStream());
		result.setResponseCode(connection.getResponseCode());
		result.setSessionId(connection.getHeaderField("Set-Cookie"));
		return result;
	}

	public InputStream getInputStream() {
		return inputStream;
	}

	public void setInputStream(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public OutputStream getOutputStream() {
		return outputStream;
	}

	public void setOutputStream(OutputStream outputStream) {
		this.outputStream = outputStream;
	}

	public int getResponseCode() {
		return responseCode;
	}

	public void setResponseCode(int responseCode) {
		this.responseCode = responseCode;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}
	
	

}
